import { Badge } from 'antd';
import React from 'react';
import { useModel } from 'umi';
import AvatarSelf from './AvatarDropdown';

import styles from './index.less';
import imgMessage from '@/assets/message.png';


export type SiderTheme = 'light' | 'dark';

const GlobalHeaderRight: React.FC = () => {
  // const { changeTheme, theme } = props;
  const { initialState } = useModel('@@initialState');

  if (!initialState || !initialState.settings) {
    return null;
  }

  const { navTheme, layout } = initialState.settings;
  let className = styles.right;

  if ((navTheme === 'dark' && layout === 'top') || layout === 'mix') {
    className = `${styles.right}  ${styles.dark}`;
  }
  return (
    <div className={styles.rightContentWrap}>
      <div className={styles.right}>
        <div className={styles.message}>
          <Badge count={5}>
            <img src={imgMessage} alt="加载失败..." />
          </Badge>
        </div>
        <div className="avatar">
          <AvatarSelf />
        </div>
      </div>
    </div>
  );
};
export default GlobalHeaderRight;
